package init

import (
	"api_gateway/basic/config"
	courier "api_gateway/basic/proto/courier"
	"flag"
	"google.golang.org/grpc"
	"google.golang.org/grpc/credentials/insecure"
	"log"
)

// 初始化快递员服务的gRPC客户端
func InCourierGrpc() {
	flag.Parse()
	conn, err := grpc.NewClient("127.0.0.1:50052", grpc.WithTransportCredentials(insecure.NewCredentials()))
	if err != nil {
		log.Fatalf("did not connect: %v", err)
	}

	config.CourierClient = courier.NewCourierClient(conn)
}
